package com.pda.gongpin.adapter;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import com.pda.gongpin.R;
import com.pda.gongpin.bean.TakeStockBean;
import com.pda.gongpin.utils.Utils;
import com.wangshen.base.ui.mvp.base.adapter.BaseAdapter;

import java.util.List;



public class StockStatisticsDetailAdapter extends BaseAdapter<TakeStockBean> {

    public StockStatisticsDetailAdapter(int layoutResId, @Nullable List<TakeStockBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, TakeStockBean item) {
        super.convert(helper, item);
        helper.setText(R.id.tv_sequenceNo, "：" + item.getSequenceNo());
        helper.setText(R.id.tv_storagebinId, "：" + item.getStoragebinId());
        helper.setText(R.id.tv_inventory, item.getStockNum() + Utils.getArticleUnit(getContext(), item.getArticleUnit()));
        helper.setText(R.id.tv_actualNum, item.getActualNum() + Utils.getArticleUnit(getContext(), item.getArticleUnit()));
        helper.setText(R.id.tv_goods_code, item.getArticleId());
        helper.setText(R.id.tv_goods_name, item.getArticleName());
        helper.setText(R.id.tv_specification, item.getSpec() + "");
        helper.setText(R.id.tv_delivery_time, item.getEntryTime());
        helper.setText(R.id.tv_product_time, item.getProductTime());
        helper.setText(R.id.tv_admire_date, item.getExpiringTime());
        if (item.getCheckStatus() == 0) {
            helper.setText(R.id.tv_quality_status, getContext().getString(R.string.without_quality_inspection));
        } else if (item.getCheckStatus() == 10) {
            helper.setText(R.id.tv_quality_status, getContext().getString(R.string.quality_inspection));
        } else {
            helper.setText(R.id.tv_quality_status, getContext().getString(R.string.have_quality_inspection));
        }

    }
}